package com.jash.alipaytest;

import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity implements AsyncPayTask.Callback{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
    public void pay(View view) {
        String orderInfo = new OrderInfoBuilder(true, "1", 0.01f)
                .setBody("详情")
                .setTimeout_express("2h")
                .build();
        new AsyncPayTask(this).execute(orderInfo);
    }

    @Override
    public void callback(@Nullable String error) {
        if (error != null) {
            Toast.makeText(this, error, Toast.LENGTH_SHORT).show();
        } else {

        }
    }
}
